project(
    'vtkhdf-fortran',
    'fortran',
    'c',
    version: '0.1.0',
    license: 'MIT',
    meson_version: '>= 1.1.0',
    default_options: ['buildtype=release', 'fortran_std=f2018'],
)

fargs = ['-ffree-line-length-none', '-fimplicit-none', '-cpp']

if host_machine.system() != 'windows'
    fargs += ['-DINTEL_BUG20240327']    # 低版本或 Linux 中 GFortran 的 HDF5 库涉及这个 BUG
endif

if get_option('Enable_FP8')
    fargs += ['-DVTKHDF_USE_DOUBLE_PRECISION']
endif

vtkhdf_src = files()
subdir('src')

vtkhdf_lib = library(
    meson.project_name(),
    vtkhdf_src,
    version: meson.project_version(),
    dependencies: [dependency('hdf5', language: 'c', version: '>= 1.10.0')],
    fortran_args: fargs,
    install: true,
)
vtkhdf_dep = declare_dependency(
    link_with: vtkhdf_lib,
    include_directories: vtkhdf_lib.private_dir_include(),
)

